package com.howard.app.nivada.bo;

import java.util.ArrayList;
import java.util.List;

public class Group implements Comparable{
	public static String[] GROUP_NAMES={"出样标准","网购表","停单停产B表","停单停产C表"};
	private String name;
	private List<Product> productList;
	Integer count = 0;
	Integer typeCount = 0;
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public List<Product> getProductList() {
		if(productList == null){
			productList = new ArrayList<Product>();
		}
		return productList;
	}
	public void setProductList(List<Product> productList) {
		this.productList = productList;
	}
	public Integer getCount() {
		return count;
	}
	public void setCount(Integer count) {
		this.count = count;
	}
	public Integer getTypeCount() {
		return typeCount;
	}
	public void setTypeCount(Integer typeCount) {
		this.typeCount = typeCount;
	}
	
	//if not find, return -1
	public int getGroupIdx(){
		for(int i = 0 ; i < GROUP_NAMES.length ; i ++){
			if(name.equals(GROUP_NAMES[i])){
				return i;
			}
		}
		return -1;
	}
	
	public int compareTo(Object o) {
		return getGroupIdx() - ((Group) o).getGroupIdx();
	}
}
